import os
from pathlib import Path

# 讯飞API配置 - 用于语音识别服务
XFYUN_APP_ID = os.getenv("XFYUN_APP_ID", "0145e502")
XFYUN_API_KEY = os.getenv("XFYUN_API_KEY", "bd0df703b713e8525e22d0768900bd2d")
XFYUN_API_SECRET = os.getenv("XFYUN_API_SECRET", "ODQwZDY0NDdkOGY1NTJiZDY5MGZiNTcx")

# 讯飞API配置 - 用于声纹识别
VOICE_APP_ID = os.getenv("VOICE_APP_ID", "8e1feb3f")
VOICE_API_KEY = os.getenv("VOICE_API_KEY", "37f0c0548486760e642db19262206878")
VOICE_API_SECRET = os.getenv("VOICE_API_SECRET", "MzE2MzUzYjA4OWI0ZDVkNjFjM2Y0MDQ0")

# 声纹库配置
VOICE_DB_GROUP_NAME = os.getenv("VOICE_DB_GROUP_NAME", "707VoiceDB")
VOICE_DB_GROUP_ID = os.getenv("VOICE_DB_GROUP_ID", "001") # 目前是001

# WebSocket服务器配置 - 用于前后端通信
WEBSOCKET_HOST = "localhost"
WEBSOCKET_PORT = 3000

# 前端页面配置
FRONTEND_URL = "http://localhost:9005"

# 管理员密码配置
ADMIN_PASSWORD = "707707"

# 状态图片路径 - 桌面宠物不同状态下的图标
STATE_IMAGES = {
    'idle': 'assets/icon.png',
    'listening': 'assets/icon.png',
    'thinking': 'assets/icon.png',
    'speaking': 'assets/speak_icon.webp'
}

# 数据库配置 - 用于存储WAV文件
DB_CONFIG = {
    'host': '10.108.13.254',
    'database': 'fault_diagnosis',
    'user': 'fault_diagnosis',
    'password': '123456',
    'port': 3306,
    'charset': 'utf8mb4'  # 建议添加字符集，避免中文乱码
}

# 项目根目录（根据config.py的位置推导）
ROOT_DIR = Path(__file__).parent.absolute()